package com.jsu.clubmanagementsystem.model.vo.clubApplication;

import com.jsu.clubmanagementsystem.model.entity.ClubApplication;
import com.jsu.clubmanagementsystem.model.vo.club.ClubVO;
import com.jsu.clubmanagementsystem.model.vo.user.UserVO;
import com.jsu.clubmanagementsystem.model.vo.review.ReviewVO;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Data
public class ClubApplicationVO implements Serializable {
    /**
     * id
     */
    private Long id;

    /**
     * 申请用户
     */
    private UserVO userVo;

    /**
     * 社团(申请类型为5时, 值为null)
     */
    private ClubVO clubVo;

    /**
     * 申请原因
     */
    private String reason;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 审核结果
     */
    private ReviewVO reviewVO;

    /**
     * 申请类型
     */
    private Integer type;

    /**
     * (新)社团名称
     */
    private String clubName;

    /**
     * (新)社团简介
     */
    private String clubIntroduction;

    /**
     * 标签列表（json 数组），仅申请类型为7时有值
     */
    private List<String> clubTags;

    /**
     * 新社长
     */
    private UserVO newManager;

    private static final long serialVersionUID = 1L;

    public static ClubApplicationVO objToVo(ClubApplication application) {
        ClubApplicationVO applicationVO = new ClubApplicationVO();
        BeanUtils.copyProperties(application, applicationVO);
        return applicationVO;
    }
}
